package com.qf.springcloud.aircore.client;

import com.qf.springcloud.aircore.fallback.SearchClientImpl;
import com.qf.springcloud.aircore.fallback.SearchFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.Map;

// feign 整合 hystrix(明天)
@FeignClient(value = "search",fallbackFactory = SearchFallbackFactory.class)
public interface SearchClient {

    @GetMapping("/search/test")
    public String searchTest();



    // 添加功能，返回JSON
    @PostMapping("/search/add")
    public Map add(@RequestBody Map map);

    // 删除功能
    @DeleteMapping("/search/del/{id}")
    public String del(@PathVariable(value = "id") String id);

    // 修改操作
    @PostMapping("/search/update")
    public String update(@RequestParam String name, @RequestParam Integer age, @RequestParam Date birthday);

}
